package com.tianji.promotion.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.query.CodeQuery;
import com.tianji.promotion.domain.vo.CouponPageVO;
import com.tianji.promotion.service.IExchangeCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 兑换码 前端控制器
 * </p>
 *
 * @author rui
 * @since 2024-08-05
 */
@RestController
@RequestMapping("/codes")
@RequiredArgsConstructor
@Api(tags = "兑换码相关接口")
public class ExchangeCodeController {
    private final IExchangeCodeService codeService;
    @ApiOperation("分页查看兑换码")
    @GetMapping("/page")
    public PageDTO<CouponPageVO> pageQueryCodeByStatus(@Validated CodeQuery query){
        return codeService.pageQueryCodeByStatus(query);
    }
}
